{extend name="layout/layout"}
{block name="content"}
<div class="layui-main">
    {notEmpty name="list"}
    <ul class="layui-row layui-col-space30 ul_height i_ul1 " style="margin-top:20px;">
        {foreach $list as $item}
        <li class="layui-col-md4 layui-col-xs6">
            <a href="/activity/detail/{$item.id}.html" class="item dh_imgitem">
                <div class="img_box" style="height: 2.4rem;">
                    <img src="{$item.logo|default='public/activity/images/activity_default.jpg'}">
                </div>
                <div class="b1">
                    <p class="ft18 layui-elip mb14">{$item.name|default='-'}</p>
                     <p class="line-clamp2 ft14 gary_c6 mb30">{$item.abstract|default='-'}</p>
                     <p class="ft14 gary_c9">{$item.begin_time} ~ {$item.end_time}</p>
                </div>
            </a>
        </li>
        {/foreach}
    </ul>
    <div id="demo-laypage-layout-1" class="mt50 text-align-center "></div>
    {else}
    <p class="text-center" style="height: 300px;display: flex;align-items: center;justify-content: center;">
        <span>-- 暂无数据 --</span>
    </p>
   {/notEmpty}

</div>
<script>
    layui.use(function () {
        var laypage = layui.laypage;
        // 自定义排版
        laypage.render({
            elem: 'demo-laypage-layout-1',
            count: Number('{$total}'),
            theme: '#de6517',
            limit: Number('{$num}'),
            curr: Number('{$page}'),
            layout: ['count', 'prev', 'page', 'next'],
            jump: function (obj, first) {
                if (!first) {
                    window.location.href = '/list.html?page=' + obj.curr + '&num=' + obj.limit;
                }
            }
        });
    });
</script>
{/block}
